package cn.unuuc.cwl.storage.controller;

import cn.unuuc.cwl.storage.model.StorageQo;
import cn.unuuc.cwl.storage.service.StorageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("storage")
@RestController
public class StorageController {

    @Resource
    private StorageService storageService;

    @PostMapping
    public String deductStorage(@RequestBody StorageQo storageQo) {
        storageService.deductStorage(storageQo);
        return "商品库存扣除成功";
    }
}
